import { defHttp } from "@/utils/http";

// ERP 药品调价单 VO
export interface DrgPrAdjLstVO {
	pkId: number; // 主键ID,示例值(17245)
	drugId: string; // 药品id,示例值(28901)
	purPrice: number; // 采购价格，单位：元,示例值(7387)
	salePrice: number; // 销售价格，单位：元,示例值(24524)
	approveStatus: string; // 审批状态,示例值(2)
}

// ERP 药品调价单 API
export const DrgPrAdjLstApi = {
	// 查询药品调价单分页
	getDrgPrAdjLstPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/drug-price-adjust/page`, params });
	},

	// 查询药品调价单详情
	getDrgPrAdjLst: async (id: number) => {
		return await defHttp.get({ url: `/whs/drug-price-adjust/get?id=` + id });
	},

	// 新增药品调价单
	createDrgPrAdjLst: async (data: DrgPrAdjLstVO) => {
		return await defHttp.post({ url: `/whs/drug-price-adjust/create`, data });
	},

	// 修改药品调价单
	updateDrgPrAdjLst: async (data: DrgPrAdjLstVO) => {
		return await defHttp.put({ url: `/whs/drug-price-adjust/update`, data });
	},

	// 删除药品调价单
	deleteDrgPrAdjLst: async (id: number) => {
		return await defHttp.delete({
			url: `/whs/drug-price-adjust/delete?id=` + id
		});
	},

	// 导出药品调价单 Excel
	exportDrgPrAdjLst: async (params: any) => {
		return await defHttp.download({ url: `/whs/drug-price-adjust/export-excel`, params });
	}
};
